package de.mpii.extract;

import java.io.File;
import java.net.URL;
import java.util.List;

import de.mpii.util.Uio;
import de.mpii.web.Downloader;
import de.mpii.web.Google;
import de.mpii.web.SearchEngine;

public class StringMatchExtractor {

	public static void f1() throws Exception {

		SearchEngine google = new Google();

		List<URL> urls = google.search("list of artists");
		Downloader downloader;

		for (int i = 0; i < urls.size(); i++) {
			if (i == 0)
				continue;

			URL url = urls.get(i);

			downloader = new Downloader(url);
			System.out.println(">> TO DOWNLOAD: " + url.toString());

			String content = downloader.download();

			Uio.save(new File("G:/a.html"), content);

			break;

		}

		System.out.println("Bye.");

	}

	public static void main(String[] args) throws Exception {

	}

	public StringMatchExtractor() {

	}

}
